import { lazy } from "react";
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  ReadOutlined,
  UserOutlined,
  AreaChartOutlined,
  SoundOutlined,
  TeamOutlined
} from "@ant-design/icons";
import { createBrowserRouter, Navigate } from "react-router-dom";
let Home = lazy(() => import("../pages/home/Index"));
let Yongh = lazy(() => import("../pages/yongh/Index"));
let My = lazy(() => import("../pages/my/Index"));
let Order = lazy(() => import("../pages/order/Index"));
let Qita = lazy(() => import("../pages/qita/Index"));
let Bum = lazy(() => import("../pages/bum/Index"));
let Chans = lazy(() => import("../pages/chans/Index"));
let Gangw = lazy(() => import("../pages/gangw/Index"));
let Keh = lazy(() => import("../pages/keh/Index"));
let Tongg = lazy(() => import("../pages/tongg/Index"));
let Zid = lazy(() => import("../pages/zid/Index"));
let Wenj = lazy(() => import("../pages/wenj/Index"));

export const Homerouter = [
  {
    path: "/home/yongh",
    element: <Yongh></Yongh>,
    title: "用户管理",
    icon: <DesktopOutlined></DesktopOutlined>,
  },
  {
    path: "/home/order",
    element: <Order></Order>,
    title: "角色管理",
    icon: <PieChartOutlined></PieChartOutlined>,
  },
  {
    path: "/home/qita",
    element: <Qita></Qita>, 
    title: "菜单管理",
    icon: <FileOutlined></FileOutlined>,
  },

  {
    path: "/home/Bum",
    element: <Bum></Bum>,
    title: "部门管理",
    icon: <UserOutlined></UserOutlined>,
  },
  {
    path: "/home/gangw",
    element: <Gangw></Gangw>,
    title: "岗位管理",
    icon: <PieChartOutlined></PieChartOutlined>,
  },
  {
    path: "/home/zid",
    element: <Zid></Zid>,
    title: "字典管理",
    icon: <ReadOutlined />
  },
  {
    path: "/home/chans",
    element: <Chans></Chans>,
    title: "参数设置",
    icon: <AreaChartOutlined />
  },
  {
    path: "/home/Tongg",
    element: <Tongg></Tongg>,
    title: "通告公告",
    icon: <SoundOutlined />
  },
  {
    path: "/home/keh",
    element: <Keh></Keh>,
    title: "客户端",
    icon: <UserOutlined></UserOutlined>,
  },
  {
    path: "/home/wenj",
    element: <Wenj></Wenj>,
    title: "文件管理",
    icon:<TeamOutlined />
  },
];

const routers = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to={"/home"}></Navigate>,
  },
  {
    path: "/home",
    element: <Home></Home>,
    children: Homerouter,
  },
]);
export default routers;
